package com.designed.pattern.behavioral.strategy.core;

import com.designed.pattern.behavioral.strategy.CashSuper;

/**
 * @author yifei
 * @description 策略模式，将子类通过构造方法添加。实现不同的功能
 * @date 2024/1/2
 **/
public class CashContext {
    private CashSuper cs;

    public CashContext(CashSuper cashSuper) {
        this.cs = cashSuper;
    }

    public double getResult(double price, int num){
        return this.cs.acceptCash(price, num);
    }
}
